<template>
  <view class="whole">
    <view class="notice">联系人姓名:</view>
    <view class="bootm">
      <input
        class="modal-input"
        type="text"
        v-model="apply_name"
        placeholder="请输入联系人姓名"
        placeholder-style="font-size:32rpx"
        style="font-size: 32rpx"
      />
    </view>

    <view class="notice">联系人电话:</view>
    <view class="bootm">
      <input
        class="modal-input"
        type="text"
        v-model="apply_phone"
        placeholder="请输入联系人电话"
        placeholder-style="font-size:32rpx"
        style="font-size: 32rpx"
      />
    </view>

    <view class="notice">企业名称:</view>
    <view class="bootm">
      <input
        class="modal-input"
        type="text"
        v-model="apply_company"
        placeholder="请输入企业名称"
        placeholder-style="font-size:32rpx"
        style="font-size: 32rpx"
      />
    </view>

    <view class="fixed">
      <view class="fixed_button" @click="Submit">提交</view>
    </view>
  </view>
</template>

<script>
import api from "../../api/api";
import tip from "@/utils/tip.js";
import { uploadImage } from "../../utils/upLoad.js";
export default {
  data() {
    return {
      show: false,
      apply_name: "",
      apply_phone: "",
      apply_company: "",
    };
  },
  onShow() {},
  methods: {
    async Submit() {
      if (this.apply_name == "") {
        tip.defaults("请输入联系人姓名");
        return;
      }
      if (this.apply_phone == "") {
        tip.defaults("请输入联系人电话");
        return;
      }
      if (this.apply_company == "") {
        tip.defaults("请输入企业名称");
        return;
      }
      //   if (!/^1[3456789]\d{9}$/.test(this.contact_phone)) {
      //     this.$refs.uToast.show({
      //       title: "请填写正确手机号",
      //       type: "error",
      //     });
      //     return;
      //   }

      let res = await api.cooperateApplyCommit({
        query: {
          contact_name: this.apply_name,
          contact_phone: this.apply_phone,
          enterprise_name: this.apply_company,
        },
        method: "post",
      });
      if (res.code == 0) {
        tip.defaults("提交成功");
        setTimeout(() => {
          uni.navigateBack({
            delta: 1, //返回的页面数，如果 delta 大于现有页面数，则返回到首页,
          });
        }, 500);
      } else {
        tip.defaults(res.msg);
      }
    },
  },
};
</script>

<style lang="scss" scoped>
@import "../../style/yuanchuang.scss";
.whole {
  background-color: $bg-color1;
  min-height: 100vh;
  .input_top {
    color: #bbbbbe;
    height: 100rpx;
    margin-left: 30rpx;
  }
  .input_center {
    color: #ffffff;
    // height: 260rpx;
    padding: 30rpx 0 100rpx;
    margin-left: 30rpx;
    word-break: break-all;
  }
  .input {
    position: relative;
    top: 30rpx;
    background-color: $bg-color3;
    color: #ffffff;
  }
  .upload_upload {
    display: flex;
    align-content: flex-start;
  }
  .upload {
    margin-top: 20rpx;
    background-color: $bg-color3;
    height: 300rpx;
    padding-left: 20rpx;
  }
  .notice {
    margin: 30rpx;
    // width: 160rpx;
    height: 44rpx;
    font-size: 32rpx;
    font-weight: 400;
    color: #ffffff;
    line-height: 44rpx;
  }
  .bootm {
    background-color: $bg-color3;
    display: flex;
    align-items: center;
    // padding: 10rpx;
    padding: 30rpx 40rpx;
    .set_name {
      padding: 20rpx 30rpx;
      color: #bbbbbe;
      font-size: 32rpx;
    }
    .modal-input {
      color: #ffffff;
    }
  }
  .button {
    position: relative;
    top: 100rpx;
    margin: 30rpx;
    height: 90rpx;
    color: $text-color4;
    background: $button;
    background-repeat: no-repeat;
    background-size: 100%;
    text-align: center;
    line-height: 90rpx;
    font-size: 32rpx;
    border-radius: 16rpx;
  }
  .upload_img {
    margin-left: 20rpx;
    // margin-top: 10rpx;
    width: 85rpx;
    height: 85rpx;
    padding: 45rpx;
    background-color: #999999;
  }
}
.fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  width: 750rpx;
  height: 130rpx;
  background: #292b2b;
  &_button {
    width: 670rpx;
    height: 90rpx;
    margin: 20rpx auto 0;
    background: $button;
    background-repeat: no-repeat;
    background-size: 100%;

    font-size: 32rpx;
    font-weight: 400;
    color: #ffffff;
    line-height: 90rpx;
    text-align: center;
  }
}
.review {
  padding-top: 76rpx;
  width: 530rpx;
  height: 580rpx;
  background: #292b2b;
  border-radius: 22rpx;
  text-align: center;

  &_image {
    width: 300rpx;
    height: 320rpx;
  }
  &_row1 {
    margin-top: 20rpx;
    // width: 160rpx;
    height: 44rpx;
    font-size: 32rpx;
    font-weight: 400;
    color: #ffffff;
    line-height: 44rpx;
  }
  &_row2 {
    margin-top: 10rpx;
    // width: 120rpx;
    height: 34rpx;
    font-size: 24rpx;
    font-weight: 400;
    color: #ffffff;
    line-height: 34rpx;
  }
}
.fail {
  padding-top: 50rpx;
  text-align: center;
  &_image {
    width: 60rpx;
    height: 60rpx;
  }
  &_row1 {
    margin-top: 14rpx;
    // width: 144rpx;
    height: 50rpx;
    font-size: 36rpx;
    font-weight: 500;
    color: #ffffff;
    line-height: 50rpx;
  }
  &_row2 {
    margin-top: 10rpx;
    // width: 392rpx;
    height: 40rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: #1fe7e7;
    line-height: 40rpx;
  }
}
</style>
